// page/mall/product_detial.js
Page({
    data: {
        isHide: 0,
        imgUrls: [],
        indicatorDots: true,
        indicatorColor: "rgba(255,255,255,.3)",
        indicatorActiveColor: "rgba(255,255,255,1)",
        autoplay: true,
        interval: 5000,
        duration: 1000,
        course: {}
    },

    /**
     * 生命周期函数--监听页面加载
     */

    onLoad: function (options) {
      var that = this;
      that.setData({
        options: options,
      })
    },
    onShow: function () {
      var app = getApp()
      var that = this;
      wx.request({
        url: app.globalData.host + '&g=App&m=Goods&a=info',
        data: { id: that.data.options.id },
        header: {
          'content-type': 'application/json'
        },  
        success: function (res) {
          console.log(res.data)
          that.setData({
            bannerItem: res.data.ad.banner,
            ad: res.data.ad,
            imgUrl: res.data.ad.imgs
          })
          // console.log(that.data.ad)
        }
      })
      that.setData({
        isHide: 1,
      })
    },
    bindPhoneCall: function () {
      wx.makePhoneCall({
        phoneNumber: 'tpl',  //电话号码
      })
    }
})